import {SettingAction} from "./settingAction";

const defaultState = {
    lightThreshold: 20,
    screenOff: 20
};

export const SET_LIGHT_THRESHOLD = "SET_LIGHT_THRESHOLD"
export const SET_SCREEN_OFF = "SET_SCREEN_OFF"

export default (state = defaultState, action: SettingAction) => {
    switch (action.type) {
        case SET_LIGHT_THRESHOLD:
            return {...state,lightThreshold:action.payload };
            break;
        case SET_SCREEN_OFF:
            return {...state,screenOff:action.payload };
            break;
        default:
            return {...state};
    }
};
